package com.ddyx.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.jms.Destination;

import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Service;

import com.ddyx.mapper.CustomerContactMapper;
import com.ddyx.service.ICustomerContactService;
import com.ddyx.util.EventTag;
import com.ddyx.util.MQUtil;
import com.ddyx.util.RequestForm;
import com.ddyx.util.ResponseForm;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service
public class CustomerContactServiceImpl implements ICustomerContactService {
	
	@Resource
	CustomerContactMapper customerContactMapper;
	
	/* 
	 * 获取用户关注过 的门店信息
	 */
	@SuppressWarnings("unchecked")
	@Override
	public ResponseForm getAllGuide(RequestForm param) {
		ResponseForm result = new ResponseForm();
		if(param.getData()!=null) {
			Map<String, Object> paramMap = (Map<String, Object>) param.getData();
			try {
				paramMap = com.ddyx.util.Page.parsePage(paramMap);
				Page<Object> pageHelper = PageHelper.startPage((int) paramMap.get("page"), (int) paramMap.get("size"));
				List list = customerContactMapper.getAllGuide(paramMap);
				result.setTotal((int) pageHelper.getTotal());
				result.setData(list);
				
			} catch (Exception e) {
				e.printStackTrace();
				result.setStatus(false);
				result.setMessage("操作有误");
				log.error("操作有误");
			}
			return result;
		}
		return null;
	}

}
